Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <avr/io.h>
- #include <util/delay.h>
- #define BLINK_DELAY_MS 1000
- int main(void)
- {
- /* set pins 0-3 of PORTB for output*/
- // DDRB = 0xFF;
- // DDRB |= _BV(DDB0);
- // DDRB |= _BV(DDB1);
- // DDRB |= _BV(DDB2);
- // DDRB |= _BV(DDB3);
- //PORTB = 0x00;
- PORTB = 0x02;
- _delay_ms(1000);
- while(1) {
- PORTB = 0x05;
- _delay_ms(1000);
- PORTB = 0x02;
- _delay_ms(1000);
- };
- return 0;
- }
- int main2(void)
- {
- /* set pins 0-3 of PORTB for output*/
- DDRB = 0xFF;
- DDRB |= _BV(DDB0);
- DDRB |= _BV(DDB1);
- DDRB |= _BV(DDB2);
- DDRB |= _BV(DDB3);
- //PORTB = 0x00;
- PORTB = 0x05;
- _delay_ms(1000);
- //main2();
- while(1) {};
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement